<script>
	import {request} from 'utils/request.js'
	import Vue from 'vue'
	
	export default {
		onLaunch: function() {
			this.hideTabbar()
			this.getSystemInfo()
			// this.getInibasis()
		},
		onShow: function() {
			
		},
		onHide: function() {
			
		},
		methods:{
			getInibasis(){
				let that = this;
				request.get({
					url:'/baseconfig/inibasis',
				}).then(res=>{
					if(res.code == 1){
						console.log('getInibasis:', res);
						let iniData = res.data.ini;
						let agreementData = res.data.agreement;
						
						that.$u.vuex('logoUrl', iniData.logo);
						that.$u.vuex('miniProgramName', iniData.name);
					}
				})
			},
			hideTabbar(){
				uni.hideTabBar({
					animation:false
				})
			},
			getSystemInfo(){
				let that = this
				uni.getSystemInfo({
				    success: function (e) {
						that.$u.vuex('vuex_platform', e.platform);
						
						// #ifndef MP
						Vue.prototype.StatusBar = e.statusBarHeight;
						if (e.platform == 'android') {
							Vue.prototype.CustomBar = e.statusBarHeight + 50;
						} else {
							Vue.prototype.CustomBar = e.statusBarHeight + 45;
						};
						// #endif
									
						// #ifdef MP-WEIXIN
						Vue.prototype.StatusBar = e.statusBarHeight;
						let custom = wx.getMenuButtonBoundingClientRect();
						Vue.prototype.Custom = custom;
						Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
						// #endif		
									
						// #ifdef MP-ALIPAY
						Vue.prototype.StatusBar = e.statusBarHeight;
						Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
						// #endif
				    }
				});
			}
		}
	}
</script>

<style lang="scss">
	@import "uview-ui/index.scss";
	@import "common/demo.scss";
	@import "common/common.scss";
</style>
